<!DOCTYPE html>
<html lang="zh-cn">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <button @click="list.splice(1, 0, { id: 77, name: '赵六'})">在下标1添加元素</button>
      <ul>
        <!-- 
          如果有key，它就按key复用，找到key值一样的来复用
         -->
        <li v-for="(item, index) in list" :key="item.id">
          <input type="text" />
          {{ item.name }}
        </li>
      </ul>
    </div>
    <script src="./vue.js"></script>
    <script>
      new Vue({
        el: '#app',
        data () {
          return {
            list: [
              { id: 55, name: '张三'},
              { id: 33, name: '李四'},
              { id: 22, name: '王五'},
            ]
          }
        },
        methods: {}
      })
    </script>
  </body>
</html>
